/**
 * Copyright (c) 2015 www.smarthome.com All rights reserved. <br />
 * 本软件源代码版权归xxxx公司,未经许可不得任意复制与传播.<br />
 *
 */
package com.smarthome.domain.enums;

/**
 *
 * Worker任务类型枚举类
 *
 * @author KongXiangyu
 *
 * @since 1.0
 */
public enum WorkerJobStatusEnum {
    /** 可用 **/
    AVAILABLE(1, "可用"),
    /** 不可用 **/
    UNAVAILABLE(2, "不可用");

    private int status;
    private String comment;

    private WorkerJobStatusEnum(int status, String comment) {
        this.status = status;
        this.comment = comment;
    }

    public int getStatus() {
        return status;
    }

    public String getComment() {
        return comment;
    }

    public static WorkerJobStatusEnum getByStatus(int status) {
        for (WorkerJobStatusEnum workerTaskType : values()) {
            if (workerTaskType.getStatus() == status) {
                return workerTaskType;
            }
        }
        throw new IllegalArgumentException("none-defined WorkerJobStatusEnum status,status:" + status);
    }

}
